import matplotlib.pyplot as plt
import matplotlib.animation as animation

# 创建图形和轴
fig = plt.figure()
ax = plt.axes(xlim=(0, 10), ylim=(0, 10))

# 初始化空白点列表
pts, = ax.plot([], [], markersize=10, c='k', marker='o', ls='None')
beak, = ax.plot([], [], markersize=4, c='r', marker='o', ls='None')

# 初始化函数
def init():
    pts.set_data([], [])
    beak.set_data([], [])
    return pts, beak

# 更新函数
def update(frame):
    x = frame
    y = frame
    pts.set_data(x, y)
    beak.set_data(x+0.5, y+0.5)
    return pts, beak

# 创建动画
ani = animation.FuncAnimation(fig, update, frames=range(10), init_func=init, blit=True)

plt.show()